<div class="n-row">&nbsp;</div>
<?=n_mod('nrule')->topNav('站点管理','编辑站点')?>
<div class="a-form">
	<form class="a-form" method="post" name="nsite-edit" action="<?=n_url('nsite','siteSave')?>">
		<div class="n-row">
			<label class="n-col-4">站&nbsp;&nbsp;组：</label>
			<div class="n-col-5">
				<select name="gcode"  datatype="*" nullmsg="请选择站组！" errormsg="请选择站组！">
					<?php
					foreach ($data['glist'] as $k => $v) {
					?>
					<option value="<?=$v['code']?>" <?=$data['row']['gcode']==$v['code']?'selected':''?>><?=$v['code']?></option>
					<?php
					}
					?>
				</select>
				
			</div>
			<div class="n-col-3">
				<?=n_ui(n_url('nsite','guCodeEdit',array('gutype'=>'gcode')),添加)?>
			</div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<!-- <div class="n-row">
			<label class="n-col-4">用户存储：</label>
			<div class="n-col-5">
				<select name="ucode">
					<?php
					foreach ($data['ulist'] as $k => $v) {
					?>
					<option value="<?=$v['code']?>" <?=$data['row']['ucode']==$v['code']?'selected':''?>><?=$v['code']?></option>
					<?php
					}
					?>
				</select>
				
			</div>
			<div class="n-col-3">
				<?=n_ui(n_url('nsite','guCodeEdit',array('gutype'=>'ucode')),添加)?>
			</div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div> -->
		
		<div class="n-row">
			<label class="n-col-4">站&nbsp;&nbsp;点：</label>
			<div class="n-col-5">
				<input type="text" name="name" value="<?=empty($data['row']['name'])?'':$data['row']['name']?>" datatype="s2-16" errormsg="站点至少2个字符,最多16个字符！" nullmsg="请填写站点！"/>
				<span>站点名字，不允许为空</span>
			</div>
			<div class="n-col-3"></div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<div class="n-row">
			<label class="n-col-4">地&nbsp;&nbsp;址：</label>
			<div class="n-col-5">
				<input type="text" name="url" value="<?=empty($data['row']['url'])?'':$data['row']['url']?>" datatype="url" errormsg="请正确的填写url地址！" nullmsg="请填写地址！"/>
				<span>站点地址，不允许为空</span>
			</div>
			<div class="n-col-3"></div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<div class="n-row">
			<label class="n-col-4">签&nbsp;&nbsp;名：</label>
			 <div class="n-col-5">
				<input type="text" name="sign" value="<?=empty($data['row']['sign'])?'':$data['row']['sign']?>" datatype="*1-32" errormsg="签名至少1个字符,最多32个字符！" nullmsg="请填写签名！"/>
			</div>
			<div class="n-col-3"></div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<div class="n-row">
			<label class="n-col-4">编&nbsp;&nbsp;码：</label>
			<div class="n-col-5">
				<div class="a-radio">
					<label>
					<input type="radio" name="charset" value="UTF-8"<?=empty($data['row']['charset'])||'UTF-8'==$data['row']['charset']?' checked':''?> datatype="*" errormsg="编码！" nullmsg="请选择编码！"/>UTF-8
					</label>
					<label>
					<input type="radio" name="charset" value="GBK"<?=!empty($data['row']['charset'])&&'GBK'==$data['row']['charset']?' checked':''?> />GBK
					</label>
					<span>选择编码</span>
				</div>
			</div>
			<div class="n-col-3"></div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<div class="n-row">
			<label class="n-col-4">接口URL：</label>
			 <div class="n-col-5">
				<input type="text" name="api_url" value="<?=empty($data['row']['api_url'])?'':$data['row']['api_url']?>" datatype="url" errormsg="请正确的填写接口URL！" nullmsg="请填写接口URL！"/>
			</div>
			<div class="n-col-3"></div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<div class="n-row">
			<label class="n-col-4">接口host定义：</label>
			 <div class="n-col-5">
				<input type="text" name="api_host" value="<?=empty($data['row']['api_host'])?'':$data['row']['api_host']?>" datatype="url" errormsg="请正确的填写接口host！" nullmsg="请填接口host定义！"/>
			</div>
			<div class="n-col-3"></div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<div class="n-row">
			<label class="n-col-4" >描&nbsp;&nbsp;述：</label>
			 <div class="n-col-5">
				<textarea tip="请在这里输入描述"  name="descript" style="margin: 2px; width: 300px; height: 98px;"><?=empty($data['row']['descript'])?'':$data['row']['descript']?>请在这里输入描述</textarea>
			</div>
			<div class="n-col-3"></div>
		</div>
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<!-- <div class="n-row">
			<label class="n-col-4">状&nbsp;&nbsp;态：</label>
			 <div class="n-col-5">
			 	<label>
				<input type="radio" name="state" value="PLANNING"<?=empty($data['row']['state'])||'PLANNING'==$data['row']['state']?' checked':''?> />计划
				</label>
				<label>
				<input type="radio" name="state" value="DEV"<?=!empty($data['row']['state'])&&'DEV'==$data['row']['state']?' checked':''?> />开发
				</label>
				<label>
				<input type="radio" name="state" value="TEST"<?=!empty($data['row']['state'])&&'TEST'==$data['row']['state']?' checked':''?> />测试
				</label>
				<label>
				<input type="radio" name="state" value="RUNNING"<?=!empty($data['row']['state'])&&'RUNNING'==$data['row']['state']?' checked':''?> />上线
				</label>
			</div>
			<div class="n-col-3"></div>
		</div> -->
		<div class="n-row"><div class="n-col-12">&nbsp;</div></div>

		<div class="n-row">
			<div class="n-col-4"></div>
			<div class="n-col-5">
					<?php
					if(!empty($data['row']['id'])){
					?>
					<input type="hidden" name="id" value="<?=$data['row']['id']?>" />
					<?php
					}
					?>
					<input type="hidden" name="scode" value="<?=$data['row']['scode']?>" />
					<button class="a-button-green">提交</button>
			</div>
			<div class="n-col-3"></div>
		</div>
	</form>
	<div class="n-row"><div class="n-col-12">&nbsp;</div></div>
</div>
<script type="text/javascript">
$(".a-form").Validform();
function onsubmitform(){
	var url = "<?=n_url('nsite','siteSave')?>";
	var obj = $("form[name='nsite-edit'] :input");
	var data = {};
	if(obj.filter("[name='gcode']").val() == ''){
		obj.filter("[name='gcode']").focus();
		return false;
	}
	data['gcode'] = obj.filter("[name='gcode']").val();
}
</script>